package com.crl.map.view
{
	import com.crl.map.core.DepthSwaperContainer;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Graphics;
	import flash.display.InteractiveObject;
	import flash.display.Shape;
	import flash.display.Sprite;
	
	/**
	 * 地图容器; 
	 * @author crl
	 * 
	 */	
	public class MapCanvas extends Sprite
	{
		/**
		 * 鼠标触发层; 
		 */		
		private var trigger:Sprite;
		
		private var carpetContainer:Sprite;
		
		/**
		 * 地表层; 
		 */		
		private var floor:Shape;
		
		/**
		 * 寻路点; 
		 */		
		private var pathShape:Shape;
		
		/**
		 * 物品排序层;
		 */		
		private var thingContainer:DepthSwaperContainer;
		
		public function MapCanvas()
		{
			this.mouseEnabled=false;
			
			trigger=new Sprite();
			
			floor=new Shape();
			
			thingContainer=new DepthSwaperContainer();
			thingContainer.mouseEnabled=false;
			
			pathShape=new Shape();
			
			addChild(trigger);
			addChild(floor);
			
			addChild(pathShape);
			addChild(thingContainer);
		}
		
		/**
		 * 路径线绘制图; 
		 * @return 
		 * 
		 */		
		public function get pathGraphics():Graphics{
			return pathShape.graphics;
		}
		
		public function getTrigger():InteractiveObject{
			return trigger;
		}
		
		public function get triggerGraphics():Graphics{
			return trigger.graphics;
		}
		
		public function get floorGraphics():Graphics{
			return floor.graphics;
		}
		
		public function get thingLayer():DisplayObjectContainer{
			return thingContainer;
		}
	}
}